<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_student_read.css" />
<link rel="stylesheet" href="${staticServer}/css/reserve.css"/>
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/core/page_core.js"></script>
<script src="${staticServer}/inc/js/model_resp.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/htmlfilter.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/tips.js"></script>
<script src="${staticServer}/js/web/system_client_temp.js"></script>
<style type="text/css">
#statelist label {
	display: block;
	float: left;
	width: 120px;
}
table tr[class=fields] {
    background: #EFE5EB;
}
table tr[class=fields] th {
    padding-left: 0;
}
table tr[class=fields] th {
    height: 40px;
    line-height: 40px;
    padding-left: 20px;
    background: #EFE5EB;
}
table th,table td {
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #D0D0D0;
}
table tr.even_row {
    background: #fcfcfc;
}
table th, table td {
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #D0D0D0;
}
table tr>th {
    color: #999;
    font-size: 15px;
    font-weight: bold;
    text-align: right;
}
.caption {
    color: #bbb;
    font-weight: normal;
    font-size: 12px;
    font-style: italic;
}
#statelist label {
    display: block;
    float: left;
    width: 120px;
}
table tr.odd_row {
    background: #f6f6f6;
}
.caption {
    color: #bbb;
    font-weight: normal;
    font-size: 12px;
    font-style: italic;
}
.fields{ 
	position: relative; 
	top:expression(this.offsetParent.scrollTop-2); 
}

</style>
<script>
var contextPath='${contextPath}';

function starquery(){
	var url = "";
	var param_str = "";
	var sdate = $("#start_date").val();
	var edate = $("#end_date").val();
	var type = $("#type").val();
	if(sdate>edate){
		alert("选择日期出错。请重新选择！");
		$("#start_date").val(" ");
		$("#end_date").val(" ");
		return;
	}
	var params = [];
	if(!empty(sdate)) params.push("sdate=" + sdate);
	if(!empty(edate)) params.push("edate=" + edate);
	if(!empty(type)) params.push("type=" + type);
	url = "?" + params.join("&");
	location.href = "${contextPath}/oa/clientlistXz.htm"+url;
}

function download(){
		var sdate = $("#start_date").val();
		var edate = $("#end_date").val();
		var type = $("#type").val();
		if(sdate=="" || edate==""){
		     alert("请选择时间段！");
		}
		$.post("${contextPath}/oa/consultant_client_list.json", {
		"sdate":sdate,"edate":edate,"type":type
	}, function(ms) {
			var name = ms.name;
			$("#type").val(ms.type);
			var url = "http://120.55.241.58//mydata/uploadtea/xls/"+name;
			var aLink = document.createElement('a');
    		var evt = document.createEvent("HTMLEvents");
    		evt.initEvent("click", false, false);
    		aLink.download = name;
    		aLink.href = url;
    		aLink.dispatchEvent(evt);
			alert(name+"文件已下载成功!请去（D:/mydata/uploadoa/）中查看");
	});	
}
</script>
</head>
<body>
<input type="hidden" id="keyname" value="">
<input type="hidden" id="traId" value="">
<input type="hidden" id="isBySigned" value="${isBySigned}">

	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>咨询师模块</li>
			<li>&gt;</li>
			<li class="current">客户资源列表</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table class="simple_table" rel="nohover" style="min-width: 750px;">
			<tr>
				<td><label for="start_date">起始日期：</label>
				<input type="text" name="start_date" id="start_date" size="15"value="${sdate}" rel="DATE::Y-m-d" /> 
				<label for="end_date">终止日期：</label><input type="text"name="end_date" id="end_date" size="15" value="${edate}" rel="DATE::Y-m-d" />
				<select id="type">
					<option value="1">登记日期</option>
				</select>
				<input type="button" value=" 查 询 " onclick="starquery()" />
				<input type="button" value=" 下 载 " onclick="download()" />
			</tr>
		</table>
		<table>
			<tr class="fields">
				<th>客户姓名</th>
				<th>登记人</th>
				<th>客户来源</th>
				<th>客户类别</th>
				<th>所在地</th>
				<th>联系方式</th>
				<th>登记日期</th>
				<th>负责人</th>
			</tr>
			<#if list??>
				<#list list as list>
					<tr class="even_row">
						<td align="center" id="${list.id}" class="stress">
								<span>${list.nickname}</span></br>
								<em class="valid"><#if list.invalid=="0">(有效)<#else>(无效)</#if></em>
						</td>
						<td align="center" style="width:50px;">${list.rawuser}</td>
						<td align="center" style="">${list.categoryns}</td>
						<td align="center" style="">${list.sourcens}</td>
						<td align="center">${list.province}<#if list.city!=''>-${list.city}</#if></td>
						<td align="center">
						<#if list.phlist??>
							<#list list.phlist as phlist>
							<a title="<#if phlist.phone!="">电话：${phlist.phone}</#if> <#if list.qq!="">QQ：${list.qq}</#if> <#if list.weixin!="">微信：${list.weixin}</#if> <#if list.email!="">邮箱：${list.email}</#if> " id="${list.id}">
							<#assign phone = "${phlist.phone}">
							<#if phlist.name=="爸爸" || phlist.name=="妈妈">
								<em class="caption">电话：</em><br/>${phlist.phone}<br/>
								<em class="caption">关系：</em>${phlist.name}<br/>
							<#elseif phlist.guanxi!="">
								<em class="caption">电话：</em><br/>${phlist.phone}<br/>
								<em class="caption">关系：</em>${phlist.guanxi}<br/>
							<#else>
								<em class="caption">电话：</em><br/>${phlist.phone}<br/>
								<em class="caption">关系：</em>${phlist.name}<br/>
							</#if>
							</a>
     						</#list>
     						<#else>
						<a title="<#if list.phone!="" && list.phone?contains('[]')==false>电话：${list.phone}</#if> <#if list.qq!="">QQ：${list.qq}</#if> <#if list.weixin!="">微信：${list.weixin}</#if> <#if list.email!="">邮箱：${list.email}</#if> " id="${list.id}">
     						<#if list.phone!="" && list.phone?contains('[]')==false>
     						<em class="caption">电话：</em>${list.phone}
     						<#elseif list.qq!="">
     						<em class="caption">QQ:</em>${list.qq}
     						<#elseif list.weixin!="">
     						<em class="caption">微信:</em>${list.weixin}
     						<#elseif list.email!="">
     						<em class="caption">email:</em>${list.email}
     						</#if>
     						</a>
     					  </#if>
     					</td>
						<td align="center"><#if list.dateTime??>${list.dateTime}</#if></td>
						<td align="center"><#if list.ueuser??>${list.ueuser}<#else>${list.clientns}</#if></td>
					</tr>
				
	            <tr id="__TRACKING_LIST${list.id}" style="display:none">
	            	<td colspan="10" class="trackinglst" id="trackList${list.id}">
	            	</td>
	            </tr>
				</#list>
			</#if>
		</table>
		<div class="page_num" style="text-align:right;margin: 0px auto 0px auto;padding-right: 20px;">共<#if list??>${list?size}<#else>0</#if>条记录</div>
	</div>
	<div id="pager">
	<input type="hidden" id="inva" value="${invalid}" />
	<input type="hidden" id="nick" value="${nickname}">
	<input type="hidden" id="start" value="${startTime}" />
	<input type="hidden" id="end" value="${endTime}" />
	<ul id="pagination" style="padding-left: 14px">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
				
				<#if currpage==1 >
					<li class="previous-off">首页</li>
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/index/system_client_temp.htm?currPage=1&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">首页</a></li>
					<li class="previous"><a href="${contextPath}/index/system_client_temp.htm?currPage=${currpage-1}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">上一页</a></li>
					</#if>
					<input type="hidden" id="total" value="${page.pagetotal}" />	
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/system_client_temp.htm?currPage=${index_up}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/system_client_temp.htm?currPage=${index_up}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/system_client_temp.htm?currPage=${pagetotal}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/system_client_temp.htm?currPage=1&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/system_client_temp.htm?currPage=${index_up}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/system_client_temp.htm?currPage=${pagetotal}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/index/system_client_temp.htm?currPage=1&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/system_client_temp.htm?currPage=${index_up}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		 	<li class="previous-off">尾页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/system_client_temp.htm?currPage=${currpage+1}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">下一页</a></li>
			<li class="previous"><a href="${contextPath}/index/system_client_temp.htm?currPage=${page.pagetotal}&nickname=${nickname}&invalid=${invalid}&startTime=${startTime}&endTime=${endTime}&intention=${intention}">尾页</a></li>
		</#if>
		<li class="previous"><input type="text" id="pages" onkeypress="EnterPress(event)" size="10" placeholder="跳转页数" style="line-height: 30px; padding: 0 11px 0 11px;"></li>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul>
	</div>
	<div class="emptyline"></div>
	

<script>
$(document).ready(function(){
var bh =$(window).height()/2;
var bw =$("body").width()/2;
var h = $("#__DIV_CLIENT_SELECTOR").height()/2;
var w =$("#__DIV_CLIENT_SELECTOR").width()/2;
var mh = bh-h-80;
var mw = bw-w;
  $("#__DIV_CLIENT_SELECTOR").css({"top":mh,"left":mw,"position":"fixed"});
  $("#__DIV_CLIENT_SELECTOR_MASK").css("position","fixed");
});

</script>
	
</body>
</html>